package com.example.config;

import com.example.service.HelloWorld;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;
import javax.xml.ws.Endpoint;

@Configuration
public class CxfConfig {
    @Resource
    private Bus bus;
    @Resource
    private HelloWorld helloWorld;

    @Bean
    public Endpoint endpoint(){
        EndpointImpl endpoint = new EndpointImpl(bus,helloWorld);
        endpoint.publish("/HelloWorldService");
        return endpoint;
    }


}
